﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ctlFiltros.ascx.cs" Inherits="UserControls_ctlFiltros" %>
<%@ Register Src="ctlCamion.ascx" TagName="ctlCamion" TagPrefix="uc1" %>
<div class="filtroMain" style="width: 300px; height: 500px; margin-right:5px;">
   <div><strong>Fecha Desde:</strong>
       <asp:TextBox ID="txtDesde" runat="server" Width="71px" style="border: solid 1px #cccccc;">11/11/2011</asp:TextBox>
      <strong>Fecha Hasta: </strong> <asp:TextBox ID="txtHasta" runat="server" Width="71px" style="border: solid 1px #cccccc;">11/11/2011</asp:TextBox><hr />
   </div>
    <div style="width: 140px; height: 100px; float: left;">
        <strong>Tipo vehiculo</strong><hr />
        <div style="overflow-x: hidden; overflow-y: scroll; height: 75px">
            <asp:CheckBoxList ID="chkTiposVehiculo" runat="server" AutoPostBack="True" OnSelectedIndexChanged="chkTiposVehiculo_SelectedIndexChanged"
                CellPadding="0" CellSpacing="0">
            </asp:CheckBoxList>
        </div>
    </div>
    <div style="width: 140px; height: 100px; float: right">
        <strong>Flotas</strong><hr />
        <div style="overflow-x: hidden; overflow-y: scroll; height: 75px">
            <asp:CheckBoxList ID="chkFlotas" runat="server" AutoPostBack="True" OnSelectedIndexChanged="chkFlotas_SelectedIndexChanged"
                CellPadding="0" CellSpacing="0">
            </asp:CheckBoxList>
        </div>
    </div>
    <br style="clear:both;">
    <div style="overflow-x: hidden; overflow-y: scroll; padding: 5px; height: 310px;margin-top:10px;
        clear: both" id="table_Filter">
        <input id="txtFiltro" type="text" style="border: solid 1px #cccccc; width: 98%;"
            class="filter" />
        <asp:UpdatePanel ID="upVehiculos" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:GridView ID="grdVehiculos" runat="server" AutoGenerateColumns="False" Font-Size="Small"
                    Width="100%" CellPadding="0" CellSpacing="0">
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:CheckBox runat="server" ID="chkAll" OnCheckedChanged="chkAll_CheckedChanged"
                                    AutoPostBack="true" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox runat="server" ID="chk" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Descripcion" DataField="Descripcion" />
                        <asp:BoundField HeaderText="Patente" DataField="Patente" />
                        <asp:BoundField HeaderText="Flota" DataField="Flota" />
                    </Columns>
                </asp:GridView>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="chkFlotas" EventName="SelectedIndexChanged" />
                <asp:AsyncPostBackTrigger ControlID="chkTiposVehiculo" EventName="SelectedIndexChanged" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    <div class="buttoncontainer">
        <asp:LinkButton ID="cmdConsultar" runat="server" CssClass="button" OnClick="cmdConsultar_Click">Consultar</asp:LinkButton>
    </div>
</div>
<div id="divMensaje" title="Faltan datos"></div>
<script type="text/javascript">

    var prm = Sys.WebForms.PageRequestManager.getInstance();

    prm.add_endRequest(EndRequest);

    function EndRequest(sender, args) {
        $("#table_Filter").liveFilter();
    }
  
    $(document).ready(function () {
       // $.datepicker.setDefaults($.datepicker.regional["es"]);
        $("#<%=txtDesde.ClientID %>").datepicker();
        $("#<%=txtHasta.ClientID %>").datepicker();

        $("#table_Filter").liveFilter();

    });

    function ShowMessage(mensaje) {
        $("#divMensaje").dialog({modal:true, resizable:false}).html(mensaje);
    }

</script>
